#ifndef __SENSOR_PROCESSOR_H_
#define __SENSOR_PROCESSOR_H_

#include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>
#include <iostream>
#include <vector>
using namespace std;
#include "../core/core.h"

class SensorProcessor{
    public:
        SensorProcessor(tf2_ros::Buffer* tf_buffer);
        ~SensorProcessor();

        // 雷达数据转换 sensor_msgs::LaserScan -> LidarScan2D
        bool Scan2LidarScan2D(LidarScan2D& lidatr_scan_2d);
        
    private:
        // 发布LidarScan2D
        void PublishLidarScan2D(LidarScan2D lidar_scan_2d);
        // 激光雷达回调函数
        void LaserScanCallback(const sensor_msgs::LaserScanConstPtr& msg);
        
    private:
        tf2_ros::Buffer* const __tf_buffer;
        ros::NodeHandle __nh;
        ros::Publisher __base_scan_pub;
        ros::Subscriber __scan_sub;

        boost::shared_ptr<const sensor_msgs::LaserScan> __scan_ptr;  
};

#endif